<!DOCTYPE html>
<html data-layout-decorate="~{bbs/layout/layout}">
<head>
    <title>首页</title>
    <!--<script type="text/javascript" src="//scarletsky.github.io/md-avatar/md-avatar.js"></script>-->
</head>
<body>
<section data-layout-fragment="content">
    <div class="container">

        <div class="alert alert-success">
            快加入你说我说吧！<br/>
            小白更欢迎，你可以提出开发中碰到的任何问题，在这里没有人会吐嘈你，你能得到的只有开发知识<br/>
            如果你是大牛，尽情的分享你的干货吧，你可以选择是否需要积分查看，这里也是个知识变现的地方<br/>

        </div>

        <div class="row">

            <div class="col-md-9">
                <div class="panel panel-default">
                    <div class="panel-body">

                        <div class="media" data-th-each="data:${contentList}">
                            <div class="media-left">

                                <img src=""
                                     onerror="onerror=null; src=''"
                                     class="avatar-md"
                                     alt="avatar"/>
                            </div>
                            <div class="media-body">
                                <div class="media-heading">
                                    <a data-th-href="${#httpServletRequest.contextPath+'/bbs/article/'+data.id}" data-th-text="${data.title}" class="title">MongoDB问题求教</a>
                                </div>
                                <div class="article-info">

                                    <span class="glyphicon glyphicon-heart-empty text-danger"
                                          style="cursor: auto;"></span> 0

                                    &nbsp;<span><a id="authorName" data-th-href="${#httpServletRequest.contextPath+'/bbs/user/'+data.sysUser.username}" data-th-text="${data.sysUser.name}">这里是放作者</a> 发布于 <span data-th-text="${data.inTime}"></span></span>

                                    <a src="//" class="list-tag" data-th-if="${data.course!=null}">
                                        <i class="fa fa-tag"></i> [[${data.course!=null?data.course.name:''}]]
                                    </a>&nbsp;
<!--
                                    <a data-th-href="${data.course!=null?#httpServletRequest.contextPath+'/bbs/course/'+data.course.id:'//'}" class="list-tag" data-th-if="${data.course!=null}">
                                        <i class="fa fa-tag"></i> [[${data.course!=null?data.course.name:''}]]
                                    </a>&nbsp;
-->

                                </div>
                            </div>
                            <!-- 标题右边的泡泡，显示有多少回复 -->
                            <div class="media-right">
                                <span class="badge badge-default">1</span>
                            </div>

                            <div class="divide" style="margin-top: 10px;"></div>

                        </div>

                    </div>

                    <nav>
                        <input style="display: none" id="upPageNumber" data-th-value="${upPageNumber}">
                        <input style="display: none" id="downPageNumber" data-th-value="${downPageNumber}">
                        <input style="display: none" id="totalPages" data-th-value="${totalPages}">
                        <ul class="pager">
                            <li id="upPage"><a data-th-href="'?pageNo='+${upPageNumber}">上一页</a></li>

                            <!--页码-->
                            &nbsp;[[${nowPageNumber}]] / [[${totalPages}]]

                            <li id="downPage"><a data-th-href="'?pageNo='+${downPageNumber}">下一页</a></li>

                        </ul>
                    </nav>
                </div>
            </div>

            <div class="col-md-3 hidden-xs">

                <div class="panel panel-default">
                    <div class="panel-body welcome">
                        <p>
                            <b>你说我说：</b>你可以提出开发中碰到的任何问题，在这里没有人会吐嘈你，你能得到的只有开发知识</p>
                        </p>
                    </div>
                </div>

                <!--<div class="panel panel-default">
                    <div class="panel-heading"><span class="glyphicon glyphicon-th-list"></span> 热门教程</div>
                    <table class="table">

                        <tr>
                            <td>
                                <a href="/article/5bd5ddcbc19a696b04651791">最简单的React教程，开发自己的电影网站</a>
                            </td>
                        </tr>

                    </table>
                </div>-->
            </div>
        </div>

    </div>

    </div>
    <script type="text/javascript">
        $(function () {
            var upPageNumber = $('#upPageNumber').val();
            var downPageNumber = $('#downPageNumber').val();
            var totalPages = $('#totalPages').val();

            if (upPageNumber <= 0) {
                $('#upPage').addClass('disabled');
                $('#upPage a').attr('href', '//');
            }
            if (downPageNumber > totalPages) {
                $('#downPage').addClass('disabled');
                $('#downPage a').attr('href', '//');
            }
        });
    </script>
</section>
</body>
</html>